<?php
namespace app\admin\controller;
use app\admin\model\Position as PositionModel;
use app\admin\controller\Base;

class Area extends Base
{
    
    public function lst()
    {
        $list=db('area')->select();
        $this->assign('list',$list);


        return view();
    }


    
    public function del()
    {
        $id=input('id');
            if (db('area')->delete($id)){
                $this->success('区域删除成功','lst');
            }
            else {
                $this->error('区域删除失败','lst');
            }
        }


    public function ajaxadd()
    {
        $input=input();
        $save=db('area')->insert($input);
        if($save){
            return ['ECODE'=>200,'MSG'=>'添加成功'];
        }
    }






}
